Brief Announcement: Fence Insertion for Straight-line Programs is in P
نویسنده
چکیده
Relaxed memory models reorder instructions in the interest of performance. However, reordering of instructions can jeopardize correctness and memory fences should be used to preserve specic orders. Programs that carry explicit fences are over-specied as they are tied to specic architectures and memory models and are hence unportable. On the other hand, once the program species the high-level required orders, optimizing compilers can allocate optimum memory fences for multiple architectures. However, the fence insertion problem for general programs is NP-hard. In this paper, we consider fence insertion for straight-line programs. We present a polynomial-time greedy algorithm via reduction to the chain multi-cut problem.
منابع مشابه
Memorax, a Precise and Sound Tool for Automatic Fence Insertion under TSO
We introduce MEMORAX, a tool for the verification of control state reachability (i.e., safety properties) of concurrent programs manipulating finite range and integer variables and running on top of weak memory models. The verification task is non-trivial as it involves exploring state spaces of arbitrary or even infinite sizes. Even for programs that only manipulate finite range variables, the...
متن کاملCounter-Example Guided Fence Insertion under Weak Memory Models
We give a sound and complete procedure for fence insertion for concurrent finite-state programs running under the classical TSO memory model. This model allows “write to read” relaxation corresponding to the addition of an unbounded store buffer between each processor and the main memory. We introduce a novel machine model, called the Single-Buffer (SB) semantics, and show that the reachability...
متن کاملThe Best of Both Worlds: Trading Efficiency and Optimality in Fence Insertion for TSO
We present a method for automatic fence insertion in concurrent programs running under weak memory models that provides the best known trade-off between efficiency and optimality. On the one hand, the method can efficiently handle complex aspects of program behaviors such as unbounded buffers and large numbers of processes. On the other hand, it is able to find small sets of fences needed for e...
متن کاملFaster fully compressed pattern matching algorithm for a subclass of straight-line programs
We show an efficient pattern-matching algorithm for strings that are succinctly described in terms of straight-line programs, in which the constants are symbols and the only operation is the concatenation. In this paper, both text T and pattern P are given by straight-line programs T and P. The length of the text T (pattern P , resp.) may grow exponentially with respect to its description size ...
متن کاملAutomatic Fence Insertion in Integer Programs via Predicate Abstraction
We propose an automatic fence insertion and verification framework for concurrent programs running under relaxed memory. Unlike previous approaches to this problem, which allow only variables of finite domain, we target programs with (unbounded) integer variables. The problem is difficult because it has two different sources of infiniteness: unbounded store buffers and unbounded integer variabl...
متن کامل